<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:h="http://xmlns.jcp.org/jsf/html"
	xmlns:f="http://xmlns.jcp.org/jsf/core"
	xmlns:ui="http://xmlns.jcp.org/jsf/facelets"
	xmlns:c="http://xmlns.jcp.org/jsf/composite"
	xmlns:p="http://primefaces.org/ui">
<h:head>

	<style>
.alignTop td {
	vertical-align: top;
}

.customTxtWidth200px .ui-inputfield .ui-inputtext .ui-widget {
	width: 200px !important;
}
</style>

	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
	<meta http-equiv="Pragma" content="no-cache" />
	<meta http-equiv="Expires" content="-1" />
	<title>VEND MACHINE</title>
	<link type="text/css" rel="stylesheet"
		href="#{request.contextPath}/css/skytef.css" />


</h:head>
<h:body>
	<ui:include src="header.xhtml" />
	<div class="central">
		<h:form style="padding-top: 80px">

			<p:growl id="msgs" showDetail="true" />

			<p:panel header="Cadastro do Menu Principal"
				style="margin-bottom:10px;margin-left:30px;margin-right:30px">
				<h:panelGrid columns="2" cellpadding="5"
					styleClass="top-aligned-columns">

					<p:tree value="#{menuMainBean.root}" var="node" dynamic="false"
						selectionMode="single" expandAnim="FADE_IN"
						collapseAnim="FADE_OUT" selection="#{menuMainBean.selectedNode}">
						<p:treeNode>
							<h:outputText value="#{node.getDescription()}" />
						</p:treeNode>
					</p:tree>

					<h:panelGrid columns="2" cellpadding="5"
						columnClasses="alignTop,alignTop">

						<p:outputLabel for="txtCategory" value="Nome: " />
						<p:inputText id="txtCategory" value="#{menuMainBean.menuNewName}"
							styleClass="customTxtWidth200px" />


						<p:outputLabel for="action" value="Ação: " />
						<p:selectOneMenu id="action" value="#{menuMainBean.action}"
							style="width:226px">
							<f:selectItem itemLabel="Selecione a ação" itemValue=""
								noSelectionOption="true" />
							<f:selectItems value="#{menuMainBean.actions}" />
						</p:selectOneMenu>


					</h:panelGrid>

				</h:panelGrid>

				<p:separator />

				<p:commandButton value="Adicionar" update="@form"
					action="#{menuMainBean.menuAdd()}" icon="ui-icon-plusthick">
				</p:commandButton>
				<p:commandButton value="Excluir" update="@form"
					action="#{menuMainBean.menuDelete()}" icon="ui-icon-minus">
				</p:commandButton>
				<p:commandButton value="Atualizar" update="@form"
					action="#{menuMainBean.menuUpdate()}" icon="ui-icon-disk">
				</p:commandButton>
				<p:commandButton value="Limpar" update="@form"
					action="#{menuMainBean.menuClear()}" icon="ui-icon-document"
					resetValues="true">
				</p:commandButton>
			</p:panel>


		</h:form>

		<p:panel id="cr" style="background: transparent; border: 0px;">
			<ui:include src="#{DashboardBean.currentRodape}" />
		</p:panel>
	</div>
	<div>
		<p:panel id="cm"
			style="background: transparent; border: 0px;margin-top:-7.0%">
			<ui:include src="#{DashboardBean.currentMenu}" />
		</p:panel>
	</div>
</h:body>
</html>
